
//define this constant if you want to use Masonry without the 'mas_' prefix
#define MAS_SHORTHAND

//define this constant if you want to enable auto-boxing for default syntax
#define MAS_SHORTHAND_GLOBALS

#import "SearchDocViewCell.h"

@interface SearchDocViewCell ()

@property (nonatomic, strong) NSMutableArray *mesArray;

@end

@implementation SearchDocViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        //设置cell没有点击效果
        [self setSelectionStyle:UITableViewCellSelectionStyleNone];
        
        //病人label
        UILabel *p_label = [[UILabel alloc] init];
        p_label.font = [UIFont systemFontOfSize:15];
        self.pLabel = p_label;
        [self.contentView addSubview:p_label];
        
        //圆view
        UIView *view = [[UIView alloc] init];
        view.backgroundColor = [UIColor colorWithRed:0.1529 green:0.3765 blue:0.5098 alpha:1.0];
        [self.contentView addSubview:view];

        //医生label
        UILabel *d_label = [[UILabel alloc] init];
        d_label.font = [UIFont systemFontOfSize:15];
        self.dLabel = d_label;
        [self.contentView addSubview:d_label];
        //圆
        UIView *roundView = [[UIView alloc]init];
        roundView.backgroundColor = [UIColor colorWithRed:0.0941 green:0.7373 blue:0.7333 alpha:1.0];
        roundView.layer.cornerRadius = 30;
        roundView.clipsToBounds = YES;
        [self.contentView addSubview:roundView];
        
        //审核label
        UILabel *p_status = [[UILabel alloc] init];
        p_status.font = [UIFont systemFontOfSize:16];
        self.status = p_status;
        [roundView addSubview:self.status];
        
#pragma
#pragma mark -- 设置约束
        
        //病人label
        [self.pLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView).multipliedBy(0.5);
            make.leading.equalTo(self.contentView).offset(10);
        }];
        
        //医生label
        [self.dLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView).multipliedBy(1.5);
            make.leading.equalTo(self.contentView).offset(10);
        }];
        
        //中间分割线
        [view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView);
            make.height.equalTo(@1);
            make.leading.equalTo(self.contentView).offset(15);
            make.trailing.equalTo(self.contentView);
        }];
        
        //圆View
        [roundView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(view);
            make.width.height.equalTo(self.contentView.mas_height).multipliedBy(0.7);
            make.trailing.equalTo(view);
        }];
        
        //审核状态
        [self.status mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.center.equalTo(roundView);
        }];
    }
    return self;
}


- (void)setModel:(SearchDocModel *)model{
    _model = model;
    self.pLabel.text = model.patient;
    
    self.dLabel.text = model.doctor;
    self.status.text = model.state;
}


@end
